package ca.camosun.proximity.tests;

import static org.junit.Assert.*;

import org.junit.Test;

import ca.camosun.proximity.Person;
import ca.camosun.proximity.SavedPerson;

public class PersonTest {

	Person one = new Person ("aaa","gggh");
	Person two = new Person ("Jack","Danels");
	Person three = new Person ("Trog","Dor");
	
	SavedPerson phone = new SavedPerson("phone","macs");
	SavedPerson cell = new SavedPerson("cell","small");
	SavedPerson lappy = new SavedPerson("Strong","Bad");
	SavedPerson smart = new SavedPerson("An","Droid");

	@Test
	public void testGetFirstName() {
		assertTrue(one.getFirstName() == "aaa");
		assertTrue(two.getFirstName() == "Jack");
	}

	@Test
	public void testGetLastName() {
		assertTrue(one.getLastName() == "gggh");
		assertTrue(three.getLastName() == "Dor");
	}
	
	@Test
	public void testEqualsObject() {
		Person notaperson = new Person ("Ima","Loss");
		assertTrue(one.equals(one));
		assertTrue(! two.equals(notaperson));
		assertTrue(! three.equals(one));
	}

	@Test
	public void testCompareTo() {
		assertTrue(one.compareTo(two) > 0);
		assertTrue(three.compareTo(two) > 0);
	}
}
